package cn.edu.baiyunu.myapplication.data.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import cn.edu.baiyunu.myapplication.data.model.Settings
import kotlinx.coroutines.flow.Flow

/**
 * 设置数据访问对象
 */
@Dao
interface SettingsDao {
    /**
     * 获取设置
     */
    @Query("SELECT * FROM settings WHERE id = 1")
    fun getSettings(): Flow<Settings?>
    
    /**
     * 插入或替换设置
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertSettings(settings: Settings)
    
    /**
     * 更新设置
     */
    @Update
    suspend fun updateSettings(settings: Settings)
} 